package cn.wolfcode.cloud.shop.mapper;

import cn.wolfcode.cloud.shop.domain.SeckillOrder;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @author Administrator
 */
@Mapper
public interface SeckillOrderMapper {

    @Select("select * from t_seckill_order where user_id = #{userId} and seckill_id = #{seckillId} ")
    SeckillOrder selectByUserIdAndSeckill(@Param("userId") Long userId, @Param("seckillId") Long seckillId);

    @Insert("insert  into t_seckill_order(user_id, order_no, seckill_id) values (#{userId},#{orderNo},#{id})")
    void insertOrder(@Param("orderNo") String orderNo, @Param("id") Long id, @Param("userId") Long userId);

}
